/**
 * 随机颜色
 * @param opacity 透明度
 */
export function randomColor(opacity: number) {
  const r = Math.floor(Math.random() * 255);
  const g = Math.floor(Math.random() * 255);
  const b = Math.floor(Math.random() * 255);
  console.log(`rgba(${r},${g},${b},${opacity})`);
  return `rgba(${r},${g},${b},${opacity})`;
}

/**
 * Guid
 */
export function Guid() {
  function S4() {
    return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
  }
  return `${S4()}${S4()}-${S4()}-${S4()}-${S4()}-${S4()}${S4()}${S4()}`;
}
